what is the purpose of constructor in java programming